package com.haojiang.mh.remote.utils

import com.haojiang.mh.remote.bean.AreaValue
import com.haojiang.mh.remote.enums.EArea
import com.haojiang.mh.remote.utils.CmdKey.FACTORY_RESET
import com.haojiang.mh.remote.utils.CmdKey.FLAT
import com.haojiang.mh.remote.utils.CmdKey.FLAT2
import com.haojiang.mh.remote.utils.CmdKey.FOOT_DOWN
import com.haojiang.mh.remote.utils.CmdKey.FOOT_UP
import com.haojiang.mh.remote.utils.CmdKey.FOOT_UP_ONLY
import com.haojiang.mh.remote.utils.CmdKey.HEAD_DOWN
import com.haojiang.mh.remote.utils.CmdKey.HEAD_DOWN_FOOT_UP
import com.haojiang.mh.remote.utils.CmdKey.HEAD_FOOT_BOTH_DOWN
import com.haojiang.mh.remote.utils.CmdKey.HEAD_FOOT_BOTH_UP
import com.haojiang.mh.remote.utils.CmdKey.HEAD_FOOT_ON_OFF
import com.haojiang.mh.remote.utils.CmdKey.HEAD_UP
import com.haojiang.mh.remote.utils.CmdKey.HEAD_UP_FOOT_DOWN
import com.haojiang.mh.remote.utils.CmdKey.HEAD_UP_FOOT_UP
import com.haojiang.mh.remote.utils.CmdKey.HEAD_UP_ONLY
import com.haojiang.mh.remote.utils.CmdKey.LOUNGE_BACK_POS
import com.haojiang.mh.remote.utils.CmdKey.LOUNGE_SET_POS
import com.haojiang.mh.remote.utils.CmdKey.LUMBAR_BACK_POS
import com.haojiang.mh.remote.utils.CmdKey.LUMBAR_DOWN
import com.haojiang.mh.remote.utils.CmdKey.LUMBAR_SET_POS
import com.haojiang.mh.remote.utils.CmdKey.LUMBAR_UP
import com.haojiang.mh.remote.utils.CmdKey.M1_BACK_POS
import com.haojiang.mh.remote.utils.CmdKey.M1_SET_POS
import com.haojiang.mh.remote.utils.CmdKey.M2_BACK_POS
import com.haojiang.mh.remote.utils.CmdKey.M2_SET_POS
import com.haojiang.mh.remote.utils.CmdKey.M3_BACK_POS
import com.haojiang.mh.remote.utils.CmdKey.M3_SET_POS
import com.haojiang.mh.remote.utils.CmdKey.MOTOR5_DOWN
import com.haojiang.mh.remote.utils.CmdKey.MOTOR5_UP
import com.haojiang.mh.remote.utils.CmdKey.MOTOR6_DOWN
import com.haojiang.mh.remote.utils.CmdKey.MOTOR6_UP
import com.haojiang.mh.remote.utils.CmdKey.MSG_10MIN
import com.haojiang.mh.remote.utils.CmdKey.MSG_20MIN
import com.haojiang.mh.remote.utils.CmdKey.MSG_30MIN
import com.haojiang.mh.remote.utils.CmdKey.MSG_AROMA_ON_OFF
import com.haojiang.mh.remote.utils.CmdKey.MSG_CONSTANT
import com.haojiang.mh.remote.utils.CmdKey.MSG_FOOT_INTENSITY_DEC
import com.haojiang.mh.remote.utils.CmdKey.MSG_FOOT_INTENSITY_INC
import com.haojiang.mh.remote.utils.CmdKey.MSG_FOOT_ON_OFF
import com.haojiang.mh.remote.utils.CmdKey.MSG_HEAD_FOOT_BOTH_OFF
import com.haojiang.mh.remote.utils.CmdKey.MSG_HEAD_FOOT_BOTH_ON
import com.haojiang.mh.remote.utils.CmdKey.MSG_HEAD_FOOT_INTENSITY_DEC
import com.haojiang.mh.remote.utils.CmdKey.MSG_HEAD_FOOT_INTENSITY_INC
import com.haojiang.mh.remote.utils.CmdKey.MSG_HEAD_FOOT_SPEED_DEC
import com.haojiang.mh.remote.utils.CmdKey.MSG_HEAD_FOOT_SPEED_INC
import com.haojiang.mh.remote.utils.CmdKey.MSG_HEAD_INTENSITY_DEC
import com.haojiang.mh.remote.utils.CmdKey.MSG_HEAD_INTENSITY_INC
import com.haojiang.mh.remote.utils.CmdKey.MSG_HEAD_ON_OFF
import com.haojiang.mh.remote.utils.CmdKey.MSG_INTENSITY1
import com.haojiang.mh.remote.utils.CmdKey.MSG_INTENSITY3
import com.haojiang.mh.remote.utils.CmdKey.MSG_MODE
import com.haojiang.mh.remote.utils.CmdKey.MSG_OFF
import com.haojiang.mh.remote.utils.CmdKey.MSG_OFF_RESET
import com.haojiang.mh.remote.utils.CmdKey.MSG_PULSE
import com.haojiang.mh.remote.utils.CmdKey.MSG_WAVE
import com.haojiang.mh.remote.utils.CmdKey.MSG_WAVE1
import com.haojiang.mh.remote.utils.CmdKey.MSG_WAVE2
import com.haojiang.mh.remote.utils.CmdKey.MSG_WAVE3
import com.haojiang.mh.remote.utils.CmdKey.PILLOW_DOWN
import com.haojiang.mh.remote.utils.CmdKey.PILLOW_LUMBAR_BOTH_DOWN
import com.haojiang.mh.remote.utils.CmdKey.PILLOW_LUMBAR_BOTH_TILT_DOWN
import com.haojiang.mh.remote.utils.CmdKey.PILLOW_LUMBAR_BOTH_TILT_UP
import com.haojiang.mh.remote.utils.CmdKey.PILLOW_LUMBAR_BOTH_UP
import com.haojiang.mh.remote.utils.CmdKey.PILLOW_UP
import com.haojiang.mh.remote.utils.CmdKey.RELAX
import com.haojiang.mh.remote.utils.CmdKey.SNORE_BACK_POS
import com.haojiang.mh.remote.utils.CmdKey.SNORE_SET_POS
import com.haojiang.mh.remote.utils.CmdKey.TV_BACK_POS
import com.haojiang.mh.remote.utils.CmdKey.TV_SET_POS
import com.haojiang.mh.remote.utils.CmdKey.UBL_OFF
import com.haojiang.mh.remote.utils.CmdKey.UBL_ON_OFF
import com.haojiang.mh.remote.utils.CmdKey.ZG2_BACK_POS
import com.haojiang.mh.remote.utils.CmdKey.ZG2_SET_POS
import com.haojiang.mh.remote.utils.CmdKey.ZG_BACK_POS
import com.haojiang.mh.remote.utils.CmdKey.ZG_SET_POS

object CmdUtil {

    //功能分类 马达,按摩器，记忆位置 等
//    val MOTOR = 0x00
//    val MOTOR_NEW = 0x01
//    val MEMORY = 0x02
//    val MEMORY_NEW = 0x03
//    val MASSAGE = 0x04
//    val MASSAGE_NEW = 0x05
//    val ALARM = 0x06
//    val LED = 0x07
//    val AROMA = 0x08


    //按键类型 长按，短按 等
//    val KEEP = 0x01           //连续
//    val ONCE = 0x02         //短按
//    val LONG = 0x03         //长按


    /**
     * 按键功能列表
     */
    val viewMap: HashMap<String, AreaValue>
        get() = hashMapOf<String, AreaValue>(

            /**
             *马达 23个命令
             */
            //（单次）一键头部上升（脚部下降）
            (HEAD_UP_FOOT_DOWN to AreaValue(
                EArea.MEMORY.key,
                HEAD_UP_FOOT_DOWN
            )),

            //（单次）一键脚部上升（头部下降）
            (HEAD_DOWN_FOOT_UP to AreaValue(
                EArea.MEMORY.key,
                HEAD_DOWN_FOOT_UP
            )),

            //（单次）一键同步上升
            (HEAD_UP_FOOT_UP to AreaValue(
                EArea.MEMORY.key,
                HEAD_UP_FOOT_UP
            )),

            //（持续）第一马达上升 头部上升
            (HEAD_UP to AreaValue(
                EArea.MOTOR.key,
                HEAD_UP
            )),

            // （持续）第一马达下降 头部下降
            (HEAD_DOWN to AreaValue(
                EArea.MOTOR.key,
                HEAD_DOWN
            )),

            //（持续）第二马达上升 脚部上升
            (FOOT_UP to AreaValue(
                EArea.MOTOR.key,
                FOOT_UP
            )),

            //（持续）第二马达下降 脚部下降
            (FOOT_DOWN to AreaValue(
                EArea.MOTOR.key,
                FOOT_DOWN
            )),

            //（持续）第一、二马达同时上升
            (HEAD_FOOT_BOTH_UP to AreaValue(
                EArea.MOTOR.key,
                HEAD_FOOT_BOTH_UP
            )),

            // （持续）第一、二马达同时下降
            (HEAD_FOOT_BOTH_DOWN to AreaValue(
                EArea.MOTOR.key,
                HEAD_FOOT_BOTH_DOWN
            )),

            //（单次）一键头部上升(不停)
            (HEAD_UP_ONLY to AreaValue(
                EArea.MEMORY.key,
                HEAD_UP_ONLY
            )),

            //（单次）一键脚部上升(不停)
            (FOOT_UP_ONLY to AreaValue(
                EArea.MEMORY.key,
                FOOT_UP_ONLY
            )),

            //（持续）第三马达上升(外拖一)
            (PILLOW_UP to AreaValue(
                EArea.MOTOR.key,
                PILLOW_UP
            )),

            //（持续）第三马达下降(外拖一)
            (PILLOW_DOWN to AreaValue(
                EArea.MOTOR.key,
                PILLOW_DOWN
            )),

            //（持续）第四马达上升(外拖二)
            (LUMBAR_UP to AreaValue(
                EArea.MOTOR.key,
                LUMBAR_UP
            )),

            //（持续）第四马达下降(外拖二)
            (LUMBAR_DOWN to AreaValue(
                EArea.MOTOR.key,
                LUMBAR_DOWN
            )),

            //（持续）第三、四马达同升(外拖一、二)
            (PILLOW_LUMBAR_BOTH_UP to AreaValue(
                EArea.MOTOR.key,
                PILLOW_LUMBAR_BOTH_UP
            )),

            //（持续）第三、四马达同降(外拖一、二)
            (PILLOW_LUMBAR_BOTH_DOWN to AreaValue(
                EArea.MOTOR.key,
                PILLOW_LUMBAR_BOTH_DOWN
            )),

            //（持续）外拖马达1和2倾斜上
            (PILLOW_LUMBAR_BOTH_TILT_UP to AreaValue(
                EArea.MOTOR.key,
                PILLOW_LUMBAR_BOTH_TILT_UP
            )),

            //（持续）外拖马达1和2倾斜下
            (PILLOW_LUMBAR_BOTH_TILT_DOWN to AreaValue(
                EArea.MOTOR.key,
                PILLOW_LUMBAR_BOTH_TILT_DOWN
            )),

            //（持续）第五马达上升(外拖三)
            (MOTOR5_UP to AreaValue(
                EArea.MOTOR.key,
                MOTOR5_UP
            )),

            //（持续）第五马达下降(外拖三)
            (MOTOR5_DOWN to AreaValue(
                EArea.MOTOR.key,
                MOTOR5_DOWN
            )),

            //（持续）第六马达上升(外拖四)
            (MOTOR6_UP to AreaValue(
                EArea.MOTOR.key,
                MOTOR6_UP
            )),

            //（持续）第六马达下降(外拖四)
            (MOTOR6_DOWN to AreaValue(
                EArea.MOTOR.key,
                MOTOR6_DOWN
            )),

            //（单次）FLAT一键复位
            (FLAT to AreaValue(
                EArea.MOTOR.key,
                FLAT
            )),

            //（单次）床底灯关
            (UBL_OFF to AreaValue(
                EArea.MOTOR.key,
                UBL_OFF
            )),

            //（单次）床底灯开关
            (UBL_ON_OFF to AreaValue(
                EArea.MOTOR.key,
                UBL_ON_OFF
            )),


            //记忆位置 20个命令-----------------------------------------------------------------

            //  (单次）第一个记忆位置
            (M1_SET_POS to AreaValue(
                EArea.MEMORY.key,
                M1_SET_POS
            )),

            //（单次）第二个记忆位置
            (M2_SET_POS to AreaValue(
                EArea.MEMORY.key,
                M2_SET_POS
            )),

            //（单次）第三个记忆位置
            (M3_SET_POS to AreaValue(
                EArea.MEMORY.key,
                M3_SET_POS
            )),

            //一键回到第一个记忆位置
            (M1_BACK_POS to AreaValue(
                EArea.MEMORY.key,
                M1_BACK_POS
            )),

            //（单次）一键第二个记忆位置
            (M2_BACK_POS to AreaValue(
                EArea.MEMORY.key,
                M2_BACK_POS
            )),

            //（单次）一键第三个记忆位置
            (M3_BACK_POS to AreaValue(
                EArea.MEMORY.key,
                M3_BACK_POS
            )),

            //（单次）一键回到腰托位置
            (LUMBAR_BACK_POS to AreaValue(
                EArea.MEMORY.key,
                LUMBAR_BACK_POS
            )),

            //（单次）一键记忆腰托位置
            (LUMBAR_SET_POS to AreaValue(
                EArea.MEMORY.key,
                LUMBAR_SET_POS
            )),

            //        //（单次）FLAT一键复位
            //        (FLAT to Cmd(
            //            EArea.MEMORY.key,
            //            FLAT
            //        )) ,

            //（单次）回到ZG（零重力）位置
            (ZG_BACK_POS to AreaValue(
                EArea.MEMORY.key,
                ZG_BACK_POS
            )),

            //(单次)回到SNORE（防打呼）位置
            (SNORE_BACK_POS to AreaValue(
                EArea.MEMORY.key,
                SNORE_BACK_POS
            )),

            //（单次）TV电视位置
            (TV_BACK_POS to AreaValue(
                EArea.MEMORY.key,
                TV_BACK_POS
            )),

            //（单次）LOUNGE休闲位置
            (LOUNGE_BACK_POS to AreaValue(
                EArea.MEMORY.key,
                LOUNGE_BACK_POS
            )),

            //（单次）解除零重力-恢复出厂设置
            (FACTORY_RESET to AreaValue(
                EArea.MEMORY.key,
                FACTORY_RESET
            )),

            //（单次）记忆TV电视位置
            (TV_SET_POS to AreaValue(
                EArea.MEMORY.key,
                TV_SET_POS
            )),

            //（单次）记忆LOUNGE休闲位置
            (LOUNGE_SET_POS to AreaValue(
                EArea.MEMORY.key,
                LOUNGE_SET_POS
            )),

            //（单次）记忆ZG零重力位置
            (ZG_SET_POS to AreaValue(
                EArea.MEMORY.key,
                ZG_SET_POS
            )),

            //(单次)记忆anti-snore位置
            (SNORE_SET_POS to AreaValue(
                EArea.MEMORY.key,
                SNORE_SET_POS
            )),

            //（单次）记忆ZG2零重力位置
            (ZG2_SET_POS to AreaValue(
                EArea.MEMORY.key,
                ZG2_SET_POS
            )),

            //（短按）回到ZG2（零重力）位置
            (ZG2_BACK_POS to AreaValue(
                EArea.MEMORY.key,
                ZG2_BACK_POS
            )),

            //(单次)FLAT2一键复位
            (FLAT2 to AreaValue(
                EArea.MEMORY.key,
                FLAT2
            )),

            //（单次）Relax
            (RELAX to AreaValue(
                EArea.MEMORY.key,
                RELAX
            )),


            //按摩器 30个命令-------------------------------------------------------------------
            //（单次）头部按摩马达开/关
            (MSG_HEAD_ON_OFF to AreaValue(
                EArea.MASSAGE.key,
                MSG_HEAD_ON_OFF
            )),

            //（单次）头部按摩马达开/关
            (MSG_FOOT_ON_OFF to AreaValue(
                EArea.MASSAGE.key,
                MSG_FOOT_ON_OFF
            )),

            //（单次）按摩马达强度增强(同时增强)
            (MSG_HEAD_FOOT_INTENSITY_INC to AreaValue(
                EArea.MASSAGE.key,
                MSG_HEAD_FOOT_INTENSITY_INC
            )),

            //（单次）按摩马达强度减弱(同时减弱)
            (MSG_HEAD_FOOT_INTENSITY_DEC to AreaValue(
                EArea.MASSAGE.key,
                MSG_HEAD_FOOT_INTENSITY_DEC
            )),

            //（单次）按摩马达速度同时增强
            (MSG_HEAD_FOOT_SPEED_INC to AreaValue(
                EArea.MASSAGE.key,
                MSG_HEAD_FOOT_SPEED_INC
            )),

            //（单次）按摩马达速度同时减弱
            (MSG_HEAD_FOOT_SPEED_DEC to AreaValue(
                EArea.MASSAGE.key,
                MSG_HEAD_FOOT_SPEED_DEC
            )),

            //（单次）按摩马达PULSE模式
            (MSG_PULSE to AreaValue(
                EArea.MASSAGE.key,
                MSG_PULSE
            )),

            //（单次）按摩马达WAVE模式-
            (MSG_WAVE to AreaValue(
                EArea.MASSAGE.key,
                MSG_WAVE
            )),

            //按摩马达CONSTANT模式
            (MSG_CONSTANT to AreaValue(
                EArea.MASSAGE.key,
                MSG_CONSTANT
            )),

            //（单次）插座开/关(香薰按键)
            (MSG_AROMA_ON_OFF to AreaValue(
                EArea.MASSAGE.key,
                MSG_AROMA_ON_OFF
            )),




            //（单次）MODE(按摩器模式切换)
            (MSG_MODE to AreaValue(
                EArea.MASSAGE.key,
                MSG_MODE
            )),

            //（单次）WAVE(第一种模式)
            (MSG_WAVE1 to AreaValue(
                EArea.MASSAGE.key,
                MSG_WAVE1
            )),

            //（单次）WAVE(第二种模式)
            (MSG_WAVE2 to AreaValue(
                EArea.MASSAGE.key,
                MSG_WAVE2
            )),

            //（单次）WAVE(第三种模式)
            (MSG_WAVE3 to AreaValue(
                EArea.MASSAGE.key,
                MSG_WAVE3
            )),

            //（单次）第一个按摩器(头部按摩器)强度增强
            (MSG_HEAD_INTENSITY_INC to AreaValue(
                EArea.MASSAGE.key,
                MSG_HEAD_INTENSITY_INC
            )),

            //（单次）第一个按摩器(头部按摩器)强度减弱
            (MSG_HEAD_INTENSITY_DEC to AreaValue(
                EArea.MASSAGE.key,
                MSG_HEAD_INTENSITY_DEC
            )),

            //（单次）第二个按摩器(脚部按摩器)强度增强
            (MSG_FOOT_INTENSITY_INC to AreaValue(
                EArea.MASSAGE.key,
                MSG_FOOT_INTENSITY_INC
            )),

            //（单次）第二个按摩器(脚部按摩器)强度减弱
            (MSG_FOOT_INTENSITY_DEC to AreaValue(
                EArea.MASSAGE.key,
                MSG_FOOT_INTENSITY_DEC
            )),

            //（单次）一键关闭按摩器，马达复位
            (MSG_OFF_RESET to AreaValue(
                EArea.MASSAGE.key,
                MSG_OFF_RESET
            )),



            //（单次）按摩器定时10分钟关闭
            (MSG_10MIN to AreaValue(
                EArea.MASSAGE.key,
                MSG_10MIN
            )),

            //（单次）按摩器定时30分钟关闭
            (MSG_30MIN to AreaValue(
                EArea.MASSAGE.key,

                MSG_30MIN
            )),

            //（单次）按摩器定时20分钟关闭
            (MSG_20MIN to AreaValue(
                EArea.MASSAGE.key,
                MSG_20MIN
            )),

            // (单次)按摩器第一强度
            (MSG_INTENSITY1 to AreaValue(
                EArea.MASSAGE.key,
                MSG_INTENSITY1
            )),

            //(单次)按摩器第三强度
            (MSG_INTENSITY3 to AreaValue(
                EArea.MASSAGE.key,
                MSG_INTENSITY3
            )),


            //（单次）按摩器开关
            (HEAD_FOOT_ON_OFF to AreaValue(
                EArea.MASSAGE.key,
                HEAD_FOOT_ON_OFF
            )),

            //（单次）两个按摩器同时开
            (MSG_HEAD_FOOT_BOTH_ON to AreaValue(
                EArea.MASSAGE.key,
                MSG_HEAD_FOOT_BOTH_ON
            )),

            //（单次）两个按摩器同时关
            (MSG_HEAD_FOOT_BOTH_OFF to AreaValue(
                EArea.MASSAGE.key,
                MSG_HEAD_FOOT_BOTH_OFF
            )),

            //（单次）STOP（按摩器停止）
                (MSG_OFF to AreaValue(
                EArea.MASSAGE.key,
                MSG_OFF
            )),

        )
}

